// 获取assets静态图片

import { ElMessage, ElMessageBox } from 'element-plus';

export const getAssetsImg = (url) => {
  return new URL(`/src/assets/img/${url}`, import.meta.url).href;
};

// 封装MessageBox/
// messageBox公用
export const useMessage = (msg, func) => {
  ElMessageBox.confirm(msg, '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
  })
    .then(() => {
      func();
    })
    .catch(() => {});
};
